﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace CostaRicaPureTravelUtils.EmailConfiguration
{
    public class EmailConfigLoader
    {
        private EmailSection emailSection;

        private static EmailConfigLoader instance;

        public static EmailConfigLoader getInstance(HttpContext context) {
            if (instance == null) {
                instance = new EmailConfigLoader(context);
            }
            return instance;
        }

        private EmailConfigLoader(HttpContext context) {
            emailSection = (EmailSection)context.GetSection("EmailConfiguration/EmailSection");
        }

        public EmailSection getEmailSection() {
            return emailSection;
        }
    }
}
